 package com.gmrz.uaf.protocol.v1.json;
 
 import com.google.gson.InstanceCreator;
 import com.google.gson.JsonDeserializationContext;
 import com.google.gson.JsonDeserializer;
 import com.google.gson.JsonElement;
 import com.google.gson.JsonNull;
 import com.google.gson.JsonParseException;
 import com.google.gson.JsonSerializationContext;
 import com.google.gson.JsonSerializer;
 import com.gmrz.uaf.protocol.v1.schema.ChannelID;
 import java.lang.reflect.Type;
 
 public class ChannelIDAdapter
   implements InstanceCreator<ChannelID>, JsonSerializer<ChannelID>, JsonDeserializer<ChannelID>
 {
   public ChannelID createInstance(Type type)
   {
     return new ChannelID();
   }
 
   public JsonElement serialize(ChannelID src, Type typeofSrc, JsonSerializationContext context)
   {
     if (src.getStrID() != null)
       return context.serialize(src.getStrID());
     if (src.getJWKKey() != null) {
       return context.serialize(src.getJWKKey());
     }
     return JsonNull.INSTANCE;
   }
 
   public ChannelID deserialize(JsonElement json, Type typeofT, JsonDeserializationContext context)
     throws JsonParseException
   {
     return new ChannelID().withStrID(json.getAsString());
   }
 }
